[tool.poetry]
name = "griptape"
version = "0.25.1"
description = "Modular Python framework for LLM workflows, tools, memory, and data."
authors = ["Griptape <hello@griptape.ai>"]
license = "Apache 2.0"
readme = "README.md"
repository = "https://github.com/griptape-ai/griptape"

packages = [
    {include = "griptape"}
]

[tool.poetry.dependencies]
python = "^3.9"
openai = "^1.1.1"
attrs = ">=22"
jinja2 = ">=3.1.3"
marshmallow = ">=3"
marshmallow-enum = ">=1.5"
tiktoken = ">=0.7"
rich = ">=13"
schema = ">=0.7"
pyyaml = ">=6"
tenacity = ">=8.0"
numpy = ">=1"
stringcase = "^1.2.0"
docker = "^6.1.3"
sqlalchemy = "~=1.0"
dateparser = "^1.1.8"
requests = "^2"

# drivers
cohere = { version = ">=4", optional = true }
anthropic = { version = "^0.20.0", optional = true }
transformers = { version = "^4.30", optional = true }
huggingface-hub = { version = ">=0.13", optional = true }
boto3 = { version = "^1.28.2", optional = true }
sqlalchemy-redshift = { version = "*", optional = true }
snowflake-sqlalchemy = { version = "^1.4.7", optional = true }
pinecone-client = { version = "^3", optional = true }
pymongo = { version = "*", optional = true }
marqo = { version = ">=1.1.0", optional = true }
redis = { version = "^4.6.0", optional = true }
opensearch-py = { version = "^2.3.1", optional = true }
pgvector = { version = "^0.2.3", optional = true }
psycopg2-binary = { version = "^2.9.9", optional = true }
google-generativeai = { version = "^0.4.1", optional = true }
trafilatura = {version = "^1.6", optional = true}
playwright = {version = "^1.42", optional = true}
beautifulsoup4 = {version = "^4.12.3", optional = true}
markdownify = {version = "^0.11.6", optional = true}
voyageai = {version = "^0.2.1", optional = true}
elevenlabs = {version = "^1.1.2", optional = true}
torch = {version = "^2.3.0", optional = true}

# loaders
pandas = {version = "^1.3", optional = true}
pypdf = {version = "^3.9", optional = true}
pillow = {version = "^10.2.0", optional = true}
mail-parser = {version = "^3.15.0", optional = true}

[tool.poetry.extras]
drivers-prompt-cohere = ["cohere"]
drivers-prompt-anthropic = ["anthropic"]
drivers-prompt-huggingface = ["huggingface-hub", "transformers"]
drivers-prompt-huggingface-pipeline = ["huggingface-hub", "transformers", "torch"]
drivers-prompt-amazon-bedrock = ["boto3", "anthropic"]
drivers-prompt-amazon-sagemaker = ["boto3", "transformers"]
drivers-prompt-google = ["google-generativeai"]

drivers-sql-redshift = ["sqlalchemy-redshift", "boto3"]
drivers-sql-snowflake = ["snowflake-sqlalchemy", "snowflake", "snowflake-connector-python"]
drivers-sql-postgres = ["pgvector", "psycopg2-binary"]

drivers-memory-conversation-amazon-dynamodb = ["boto3"]
drivers-memory-conversation-redis = ["redis"]

drivers-vector-marqo = ["marqo"]
drivers-vector-pinecone = ["pinecone-client"]
drivers-vector-mongodb = ["pymongo"]
drivers-vector-redis = ["redis"]
drivers-vector-opensearch = ["opensearch-py"]
drivers-vector-amazon-opensearch = ["opensearch-py", "boto3"]
drivers-vector-postgresql = ["pgvector", "psycopg2-binary"]

drivers-embedding-amazon-bedrock = ["boto3"]
drivers-embedding-amazon-sagemaker = ["boto3"]
drivers-embedding-huggingface = ["huggingface-hub", "transformers"]
drivers-embedding-voyageai = ["voyageai"]
drivers-embedding-google = ["google-generativeai"]

drivers-web-scraper-trafilatura = ["trafilatura"]
drivers-web-scraper-markdownify = ["playwright", "beautifulsoup4", "markdownify"]

drivers-event-listener-amazon-sqs = ["boto3"]
drivers-event-listener-amazon-iot = ["boto3"]

loaders-dataframe = ["pandas"]
loaders-pdf = ["pypdf"]
loaders-image = ["pillow"]
loaders-email = ["mail-parser"]

all = [
    # drivers
    "cohere",
    "anthropic",
    "hugginface-hub",
    "transformers",
    "sqlalchemy-redshift",
    "boto3",
    "snowflake-sqlalchemy",
    "snowflake",
    "marqo",
    "pinecone-client",
    "pymongo",
    "redis",
    "opensearch-py",
    "pgvector",
    "psycopg2-binary",
    "google-generativeai",
    "trafilatura",
    "playwright",
    "beautifulsoup4",
    "markdownify",
    "voyageai",
    "elevenlabs",
    "torch",

    # loaders
    "pandas",
    "pypdf",
    "pillow",
    "mail-parser",
]

[tool.poetry.group.test]
optional = true

[tool.poetry.group.test.dependencies]
pytest = "~=7.1"
pytest-mock = "*"
mongomock = "*"

twine = ">=4"
moto = {extras = ["dynamodb", "iotdata", "sqs"], version = "^4.2.13"}
pytest-xdist = "^3.3.1"
pytest-cov = "^5.0.0"
pytest-env = "^1.1.1"
fuzzywuzzy = "^0.18.0"
pytest-clarity = "^1.0.1"


[tool.poetry.group.dev]
optional = true

[tool.poetry.group.dev.dependencies]
ruff = "^0.4.4"
pyright = "^1.1.363"
pre-commit = "^3.7.1"
boto3-stubs = {extras = ["bedrock", "iam", "opensearch", "s3", "sagemaker"], version = "^1.34.105"}


[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
mkdocs = "^1.5.2"
mkdocs-material = "^9.2.8"
mkdocs-glightbox = "^0.3.4"
mkdocstrings = {extras = ["python"], version = "^0.23.0"}
mkdocs-gen-files = "^0.5.0"
mkdocs-literate-nav = "^0.6.0"
mkdocs-section-index = "^0.3.6"
pymdown-extensions = "^10.3"

[tool.ruff]
line-length = 120

[tool.ruff.format]
skip-magic-trailing-comma = true

[tool.pyright]
venvPath = "."
venv = ".venv"
include = ["griptape"]
exclude = [
    "**/__pycache__",
]
pythonVersion = "3.9"
reportOptionalMemberAccess = "none"
reportIncompatibleVariableOverride = "none" # see thread: https://github.com/microsoft/pyright/issues/5933 

[tool.pytest_env]
OPENAI_API_KEY = {value = "api-key", skip_if_set = true}
AZURE_OPENAI_API_KEY = { value = "api-key", skip_if_set = true}

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
